from django.db import models
from divisional_management.models import Department
# Create your models here.
# 员工表
class Employee (models.Model):
    emp_id=models.CharField('员工编号',max_length=32,unique=True,blank=False)
    name=models.CharField('姓名',max_length=32,blank=False)
    gender = models.BooleanField('性别')
    birthday = models.DateField('出生日期',default='0000-00-00')
    id_number = models.CharField('身份证号码',max_length=32,blank=False)
    nationality = models.CharField('民族',max_length=32)
    height = models.IntegerField('身高')
    weight = models.DecimalField('体重',max_digits=4,decimal_places=1)
    entry_date = models.DateField('入职日期',default='0000-00-00',blank=False)
    post = models.CharField('公司岗位',max_length=16)
    edu = models.CharField('最高学历',max_length=16)
    marriage = models.BooleanField('婚姻状况',)
    address = models.CharField('住址',max_length=128)
    phone = models.CharField('手机号码',max_length=16,blank=False)
    email = models.EmailField('邮箱号码')
    is_active = models.BooleanField('删除标记',blank=False)
    # 外键
    dep_id = models.ForeignKey(Department,on_delete=models.CASCADE)
    created_time = models.DateTimeField('创建时间',auto_now=True)
    updated_time = models.DateTimeField('修改时间',auto_now_add=True)
